<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../../common/tag.jsp"%>
<html>
<head>
<title>自定义菜单</title>
<%@ include file="../../common/header.jsp"%>
<link href="${ctx }/css/plugins/validator/validator.css"
	rel="stylesheet">
<link href="${ctx }/css/view/customMenu.css" rel="stylesheet">
</head>
<body style="background: #fff;">


	<div class="dingyibox">

		<div class="dingyih1">自定义菜单</div>

		<div class="info">可创建最多3个一级菜单，每个一级菜单下可创建最多5个二级菜单。</div>

		<div class="zidingyi">
			<div class="zidingyiLeft">
				<div class="zidingyiTItle">
					<span> <bdo>
							<a href="javascript:addup(1, 0, this);" class="jiahao"></a> <a
								href="javascript:tuoye();" class="tuoye"></a>
						</bdo> <i><a href="javascript:complete()" class="overbtn">完成</a> <a
							href="javascript:notuoye();" class="nobtn">取消</a> </i>
					</span>
					<h2>菜单管理</h2>
				</div>
				<div id="menu" class="zidingTT zidingTT2"></div>
			</div>

			<div class="zidingyiRight">
				<div class="zidingyiTItle">
					<h2>设置动作</h2>
				</div>
				<div class="">

					<div class="ibox float-e-margins">
						<!-- <div class="ibox-title">
							<h5>菜单设置</h5>
						</div> -->
						<div class="ibox-content">
							<form class="form-horizontal"
								action="${ctx }/weixin/saveMenuInfo" id="myForm" method="post"
								role="form">
								<div class="form-group">
									<label class="col-sm-2 control-label"><span
										style="color: red">*</span>菜单名称：</label>
									<div class="col-sm-10">
										<input class="form-control" id="name" name="name"
											placeholder="名称字数不超过8个汉字或16个字母" type="text" maxlength="10">
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label"><span
										style="color: red">*</span>菜单内容：</label>
									<div class="col-sm-6">
										<label class="checkbox-inline"> <input type="radio"
											value="1" checked="checked" name="type"> 发送消息
										</label> <label class="checkbox-inline"> <input type="radio"
											value="2" name="type"> 跳转网页
										</label>
									</div>
								</div>
								<div class="form-group" id="msgContainer">
									<label class="col-sm-2 control-label">&nbsp;</label>
									<div class="col-sm-10">
										<div class="bianjibox">
											<div class="bianjinav">
												<ul>
													<li class="tab_text selected" msgType="text"><a
														href="javascript:void(0);"><i class="icon_msg_sender"></i>
															<bdo>文本</bdo></a></li>
													<li class="tab_img" msgType="image"><a
														href="javascript:void(0);"><i class="icon_msg_sender"></i>
															<bdo>图片</bdo></a></li>
													<!-- <li><a href="#"><em class="img5"></em><i
															class="img5"></i> <bdo>语音</bdo></a></li>
													<li><a href="#"><em class="img7"></em><i
															class="img8"></i> <bdo>视频</bdo></a></li> -->
													<li class="tab_news" msgType="news"><a
														href="javascript:void(0);"><i class="icon_msg_sender"></i>
															<bdo>图文</bdo></a></li>
												</ul>
											</div>
											<div class="container1">
												<div id="textContainer">
													<textarea name="content" id="content" cols="" rows=""
														onkeydown="gbcount(500);" onkeyup="gbcount(500);"></textarea>
													<div class="bianjitext">还可以输入500个字符，中文占2个</div>
												</div>
												<div id="imageContainer" style="display: none;">

													<div class="col-sm-12">
														<div class="input-group">
															<input class="form-control" id="imageMediaId"
																name="imageMediaId" placeholder="请选择图片" type="text"
																readonly="readonly" /> <span class="input-group-btn">
																<button type="button" class="btn btn-primary"
																	onclick="fileIcon.click()">...</button> <input
																type="file" id="fileIcon" name="fileIcon"
																class="opacity_0">
															</span>
														</div>
													</div>

												</div>
												<div id="newsContainer" style="display: none;">

													<div class="col-sm-12">
														<div class="input-group">
															<input class="form-control" id="newsMediaId"
																name="newsMediaId" placeholder="请选择图文" type="text"
																readonly="readonly" value="${msgReply.mediaId }" /> <span
																class="input-group-btn">
																<button type="button" id="btnSelectNews"
																	class="btn btn-primary">...</button>
															</span>
														</div>
													</div>

												</div>
											</div>
										</div>
									</div>
								</div>
								<div class="form-group" id="urlContainer" style="display: none;">
									<label class="col-sm-2 control-label">页面地址：</label>
									<div class="col-sm-10">
										<input class="form-control" id="url" name="url"
											placeholder="要跳转的页面地址" type="text" value="" maxlength="300" />
									</div>
								</div>

								<div class="form-group">
									<div class="col-sm-4 col-sm-offset-3">
										<button type="button" id="btnSave" class="btn btn-primary">保
											存</button>
										<button type="button" id="btnClose" class="btn btn-default">取
											消</button>
										<input type="hidden" id="id" name="id" /> <input
											type="hidden" id="mediaId" name="mediaId" /><input
											type="hidden" id="msgType" name="msgType" />
									</div>
								</div>
							</form>
						</div>
					</div>
					<!-- <div id="divView" class="zidingyiAll" style="">
								<p>订阅者点击该子菜单会跳到以下链接</p>
								<div id="links" style="display: none;">
									<div class="zidingyikuang">
										<p></p>
									</div>
									<a href="javascript:editView();" class="quxiaobtn">修改</a>
								</div>
								<div id="nolinks" style="display: none;">
									<div class="zidingyikuang">
										<input name="txtUrl" type="text" class="txt"
											value="">
									</div>
									<a href="javascript:saveView();" class="greenbtn">保存</a> &nbsp;
									<a href="javascript:returnView();" class="quxiaobtn">返回</a>
								</div>
							</div> -->

					<%-- 	<div id="divDefault" class="zidingyichu" style="display: none;">
								<p>请选择订阅者点击菜单之后，公众号自动做出响应动作！</p>
								<ul>
									<li><a href="javascript:setNewClick()" target="_blank"><em>
												<img src="${ctx }/css/images/email.png">
										</em>发送消息</a></li>
									<li><a href="javascript:setNewView()" target="_blank"><em>
												<img src="${ctx }/css/images/web.png">
										</em>跳转到网页</a></li>
									<li><a href="javascript:editsu();" target="_blank"><em>
												<img src="${ctx }/css/images/tu.png">
										</em>选择图文消息</a></li>
								</ul>
							</div> --%>


					<!-- <div id="divClick" class="zidingyiAll" style="">
						<p>菜单名称：</p>
						<div id="nolinks" style="display: block;">
							<div class="zidingyikuang">
								<input name="txtUrl" type="text" class="txt" />
							</div>
						</div>
						<p>菜单内容:</p>

						<div id="edit" style="">
							<div class="bianjibox"
								style="width: 600px; margin-top: 10px; margin: 0;">
								<div class="bianjinav">
									<ul>
										<li><a href="#" class="curimg"><em class="img1"></em><i
												class="img2"></i> <bdo>编辑</bdo></a></li>
										<li><a href="#"><em class="img3"></em><i class="img4"></i>
												<bdo>图片</bdo></a></li>
										<li><a href="#"><em class="img5"></em><i class="img5"></i>
												<bdo>语音</bdo></a></li>
										<li><a href="#"><em class="img7"></em><i class="img8"></i>
												<bdo>视频</bdo></a></li>
										<li><a href="javascript:editsu();"><em class="img9"></em><i
												class="img10"></i> <bdo>图文</bdo></a></li>
									</ul>
								</div>
								<textarea name="txtContent" cols="" rows=""
									onkeydown="gbcount(500);" onkeyup="gbcount(500);" id="area2"></textarea>
								<div class="bianjitext">还可以输入500个字符，中文占2个</div>
							</div>
							<div class="btnbox"
								style="text-align: left; padding: 0 40px 30px; margin-top: 20px;">
								<a href="javascript:saveClick()" class="greenbtn">保存</a> &nbsp;
								<a href="javascript:returnClick();" class="quxiaobtn">取消</a>
							</div>
						</div>

					</div> -->


					<!-- <div id="divView" class="zidingyiAll" style="display: block;">
								<p>订阅者点击该子菜单会跳到以下链接</p>
								<div id="links" style="display: none;">
									<div class="zidingyikuang">
										<p></p>
									</div>
									<a href="javascript:editView();" class="quxiaobtn">修改</a>
								</div>
								<div id="nolinks" style="display: none;">
									<div class="zidingyikuang">
										<input name="txtUrl" type="text" class="txt"
											value="">
									</div>
									<a href="javascript:saveView();" class="greenbtn">保存</a> &nbsp;
									<a href="javascript:returnView();" class="quxiaobtn">返回</a>
								</div>
							</div> -->


				</div>
			</div>
		</div>

		<div class="dingyibottom">
			<span>编辑中的菜单需要进行发布才能更新到用户手机上</span>菜单正在使用中
		</div>

		<div class="btnbox">
			<a href="javascript:publishMenu();" class="btn btn-primary">发布</a>
			&nbsp;
		</div>

		<!-- <div class="tishibox" id="tishi">
			<form class="form-horizontal n-validator n-yellow" id="frmChangeName"
				method="post" action="/custommenu/ChangeMenuName.do" role="form"
				novalidate="novalidate">
				<input data-val="true" data-val-number="字段 ID 必须是一个数字。"
					data-val-required="ID 字段是必需的。" id="ID" name="ID" type="hidden"
					value="42">
				<div class="tishiTitle">
					<span><a href="javascript:close();" class="guanbi"></a></span>
					<h2>提示输入框</h2>
				</div>
				<div class="tishicon">
					<p>菜单名称名字不多于8个汉字或16个字母:</p>
					<p>
						<input class="txt" id="Name" name="Name" placeholder=""
							type="text" value="菜单管理" aria-required="true">
					</p>
				</div>
				<div class="tishibtn">
					<a href="javascript:changeName();" class="greenbtn">立即提交</a> &nbsp;
					<a href="javascript:close();" class="quxiaobtn">取消</a>
				</div>
			</form>
		</div> -->

		<!-- <div class="tishibox editAllbox" id="tishi2">
			<div class="tishiTitle">
				<span><a href="javascript:closedsu();" class="guanbi"></a></span>
				<h2>选择素材</h2>
			</div>
			<div class="editAlltab">
				<span>1/2 &nbsp; <a href="#">下一页</a> <input name=""
					type="text" class="pagetxt"> <input name="" type="button"
					value="跳转" class="pagebtn"></span> <a href="#"><em
					class="dantuwen2"></em>单图文消息</a> &nbsp;&nbsp; <a href="#"><em
					class="duotuwen2"></em>多图文消息</a>
			</div>
			<div class="editAllcon">
				<div id="tanmain">
					<ul id="tiles">
					</ul>
				</div>
			</div>
			<div class="tishibtn">
				<a href="javascript:saveGraphic();" class="greenbtn">确定</a> &nbsp; <a
					href="javascript:closedsu();" class="quxiaobtn">取消</a>
			</div>
		</div> -->

		<!-- <div class="tishibg" id="tishibg"></div>
		<div style="width: 222px; height: 1000px;"></div>
		<input id="hRootID" type="hidden" value="42"> -->
	</div>


	<div id="showNewsModal" class="modal fade">
		<div class="modal-dialog" style="width: 800px;">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title">选择图文素材</h4>
				</div>

				<div class="modal-body">

					<div class="table-responsive">
						<div class="dataTables_info" id="DataTables_Table_0_info"
							role="status" aria-live="polite">
							总共：<span id="item_total">0</span>
						</div>
						<table class="table table-striped table-bordered table-hover">
							<thead>
								<tr>
									<th>标题</th>
									<th>缩略图</th>
									<th>摘要</th>
									<th>选择</th>
								</tr>
							</thead>
							<tbody id="newsContent">

							</tbody>
						</table>
						<div class="dataTables_paginate paging_simple_numbers">

							<ul class="pagination">
								<li class="paginate_button previous"
									id="DataTables_Table_0_previous"><a href="#"
									aria-controls="DataTables_Table_0">上一页</a></li>
								<li class="paginate_button next disabled"
									id="DataTables_Table_0_next"><a href="#"
									aria-controls="DataTables_Table_0">下一页</a></li>
							</ul>
						</div>
					</div>
				</div>


				<div class="modal-footer">
					<button type="button" id="btnSaveNews" class="btn btn-primary">保
						存</button>
					<button type="button" id="btnCloseBind" class="btn btn-default"
						data-dismiss="modal">取 消</button>
				</div>
			</div>
		</div>
	</div>

</body>
</html>
<%@ include file="../../common/footer.jsp"%>
<script src="${ctx }/js/plugins/jquery.sortable.js"></script>
<script src="${ctx }/js/plugins/jquery.wookmark.js"></script>
<script src="${ctx }/js/plugins/jquery.json.js"></script>
<script src="${ctx }/js/plugins/validator/validator.js"></script>
<script src="${ctx }/js/plugins/ajaxfileupload.js"></script>
<script>
	var options = {
		getMenuList : '${ctx}/weixin/getAllMenu',
		getMenuInfo : '${ctx}/weixin/getMenuInfo',
		saveMenuInfo : '${ctx}/weixin/saveMenuInfo',
		deleteMenuInfoUrl : '${ctx}/weixin/deleteMenuInfo',
		publishMenuUrl : '${ctx}/weixin/publishMenu',
	};
</script>
<script src="${ctx }/js/view/weixin/customMenu.js"></script>

